<!DOCTYPE html>
<html>
	<head>
		<meta charset="utf-8">
		<title>登录界面</title>
		<link href="Bootstrap/bootstrap-3.3.0/css/bootstrap-theme.min.css" rel="stylesheet" />
		<link href="Bootstrap/bootstrap-3.3.0/css/bootstrap.min.css" rel="stylesheet" />
		<script src="command/jquery-3.4.0.min.js"></script>
		<script type="application/javascript">
			// 初始化相关事件的控件
			$(function() {
				// 点击添加按钮事件
				$("#submituser").click(function() {
					// alert("提交按钮事件");
					//获取文本框输入的值
					var username = $("#txtusernumber").val();
					var pwd = $("#txtpwd").val();
					//2.读取json格式的数据
					$.getJSON("json/login.json", function(data) {
						// 读取请求到的json数据
						console.log(data);
						if (username == data.name && pwd == data.pwd) {
							location.href = "czhuye.html";
						} else {
							alert("账号或密码错误，重输");
							$("#txtusernumber").val("");
							$("#txtpwd").val("");
						}
					})
				});
			});
		</script>
	</head>
	<body style="background-color: #cde6c7">
		<!-- 绘制总的控制内容 -->
		<div class="container" style="background-color: #cde6c7">
			<div class="col-md-12">
				<!-- 头部 -->
				<div class="col-md-3"></div>
				<!-- 完成登录时的主要页面 -->
				<div class="col-md-6">
					<div class="paneld panel-primary" style="margin-top: 200px;">
						<!-- 登录框中的头部 -->
						<div class="panel-heading" style="background-color: #9b95c9;">合同管理模块</div>
						<!-- 登录窗体 -->
						<div class="panel-body">
							<div class="input-group">
								<span class="input-group-addon">
									<span class="glyphicon glyphicon-user"></span>
								</span>
								<input type="text" id="txtusernumber" name="usernumber" class="form-control" maxlength="20" placeholder="请输入登录账号" />
							</div>
							<br />
							<div class="input-group">
								<span class="input-group-addon">
									<span class="glyphicon glyphicon-lock"></span>
								</span>
								<input type="password" id="txtpwd" name="pwd" class="form-control" maxlength="20" placeholder="请输入登录密码" />
							</div>
							<br />
							<div class="btn-group text-center">
								<center>
									<button id="submituser" type="submit" class="btn btn-success">提交</button>
									<button id="resetuser" type="reset" class="btn btn-danger">重置</button>
								</center>
							</div>
						</div>
					</div>
				</div>
				<!-- 底部 -->
				<div class="col-md-3"></div>
			</div>
		</div>
	</body>
</html>
